<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Home.Master" Inherits="System.Web.Mvc.ViewPage<Aga.Psad.Mvc.Models.UserAdministration.RoleViewModel>" %>

<asp:Content ContentPlaceHolderID="TitleContent" runat="server">
    Role:
    <% =Html.Encode(Model.Role) %>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" runat="server">
    <link href='<% =Url.Content("~/Content/MvcMembership/MvcMembership.css") %>' rel="stylesheet"
        type="text/css" />
    <div id="sidebar">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="box-style3">
            <tr>
                <td>
                    <h2>
                        <span>Adm.</span> de Usuarios</h2>
                </td>
            </tr>
            <tr>
                <td>
                    <ul>
                        <li class="first"><a href="<%= VirtualPathUtility.ToAbsolute("~/UserAdministration/Index") %>">
                            Ver Usuarios</a></li>
                        <li><a href="<%= VirtualPathUtility.ToAbsolute("~/Account/Register") %>">Nuevo Usuario</a></li>
                    </ul>
                </td>
            </tr>
        </table>
    </div>
    <div id="content">
        <div id="Div1">
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="box-style1">
                <tr>
                    <td id="box2">
                        <h2>
                            Role:
                            <% =Html.Encode(Model.Role) %></h2>
                        <div class="mvcMembership-roleUsers">
                            <% if (Model.Users.Count() > 0)
                               { %>
                            <table>
                                <tr>
                                    <th>
                                        Usuario
                                    </th>
                                    <th>
                                    </th>
                                </tr>
                                <% foreach (var user in Model.Users)
                                   { %>
                                <tr>
                                    <td>
                                        <% =Html.ActionLink(user.UserName, "Details", new { id = user.ProviderUserKey })%>
                                    </td>
                                    <td>
                                        <% using (Html.BeginForm("RemoveFromRole", "UserAdministration", new { id = user.ProviderUserKey, role = Model.Role }))
                                           { %>
                                        <input type="submit" value="Quitar del Rol" />
                                        <% } %>
                                    </td>
                                </tr>
                                <% } %>
                            </table>
                            <% }
                               else
                               { %>
                            <p>
                                No hay Usuarios para este Rol.</p>
                            <% } %>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
</asp:Content>
